from django.db import models

# Create your models here.

class Zhuce(models.Model):
    username = models.CharField(max_length=100)
    password = models.CharField(max_length=100)
    class Meta:
        db_table = 'zhuce'

class Xiaoqv(models.Model):
    name = models.CharField(max_length=20)
    shuoming = models.CharField(max_length=100)
    class Meta:
        db_table = 'xiaoqv'
class Banji(models.Model):
    name = models.CharField(max_length=20)
    shuoming = models.CharField(max_length=100)
    xiaoqv = models.ForeignKey(to='Xiaoqv',on_delete=models.CASCADE)
    kaishi = models.DateTimeField(auto_now=True)
    jieshu = models.DateTimeField(auto_now_add=True)
    class Meta:
        db_table = 'banji'
class Xueyuan(models.Model):
    name = models.CharField(max_length=20)
    gender = models.CharField(max_length=1)
    shouji = models.CharField(max_length=11)
    qq = models.CharField(max_length=12)
    weixin = models.CharField(max_length=20)
    sheng = models.CharField(max_length=10)
    daxue = models.CharField(max_length=15)
    zhuanye = models.CharField(max_length=15)
    xueli = models.CharField(max_length=5)
    banji = models.ForeignKey(to='Banji',on_delete=models.CASCADE)
    zhuangtai = models.CharField(max_length=20)
    xiaoqv = models.ForeignKey(to='Xiaoqv',on_delete=models.CASCADE)
    class Meta:
        db_table = 'Xueyuan'





